import { Vector } from '../../engine/common/vector';
import { KEY_CODES } from '../../engine/input/keyboard-codes';
import { IInputConfig } from '../../engine/ecs/systems/input-detection.system';
import { MovementEventComponent } from '../components/movement-event.component';
import { ShootEventComponent } from '../components/shoot-event.component';

export const inputConfig: IInputConfig = {
  eventBindings: {
    [KEY_CODES.W]: new MovementEventComponent(new Vector(0, -1)),
    [KEY_CODES.D]: new MovementEventComponent(new Vector(1, 0)),
    [KEY_CODES.S]: new MovementEventComponent(new Vector(0, 1)),
    [KEY_CODES.A]: new MovementEventComponent(new Vector(-1, 0)),
    [KEY_CODES.Space]: new ShootEventComponent(),
  },
} as const;
